From: Yi Sun Date: Thu, 31 Aug 2017 08:07:26 +0000 (+0800) Subject: x86: remove redundant checks in sysctl.c X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1510 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=e1c10ecdf7f0a4437e631bdbf887ce4af4c03a1b;p=xen.git x86: remove redundant checks in sysctl.c In sysctl.c, the return value of 'psr_get_info' has been checked immediately. So, it is redundant to check the return value again when copy the field to guest. Suggested-by: Roger Pau Monné Signed-off-by: Yi Sun Reviewed-by: Jan Beulich Reviewed-by: Roger Pau Monné --- diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index 2bde99c3c4..c3fdae81d1 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -190,7 +190,7 @@ long arch_do_sysctl( sysctl->u.psr_cat_op.u.cat_info.flags = data[PSR_INFO_IDX_CAT_FLAG]; - if ( !ret && __copy_field_to_guest(u_sysctl, sysctl, u.psr_cat_op) ) + if ( __copy_field_to_guest(u_sysctl, sysctl, u.psr_cat_op) ) ret = -EFAULT; break; } @@ -209,7 +209,7 @@ long arch_do_sysctl( sysctl->u.psr_cat_op.u.cat_info.flags = data[PSR_INFO_IDX_CAT_FLAG]; - if ( !ret && __copy_field_to_guest(u_sysctl, sysctl, u.psr_cat_op) ) + if ( __copy_field_to_guest(u_sysctl, sysctl, u.psr_cat_op) ) ret = -EFAULT; break; }